<template>
  <div class="home">
    <input type="text" class="Text"  v-model="value" />
    <button class="btn" @click="get">发送</button>
    <p class="result">{{value}}</p>
  </div>
</template>

<script>
// @ is an alias to /src

import {getValue} from "../api/test";
import {QWebChannel} from "../utils/qwebchannel";

export default {
  name: 'Home',
  data(){
    return {
      value:""
    }
  },
  mounted() {
    var that = this
    window.onload = function () {
      new QWebChannel(qt.webChannelTransport,function (channel) {
        window.bridge = channel.objects.bridge

      })


    }

    },

  methods:{
    get(){
      window.bridge.strValue = this.value


    }
  }

}
</script>

<style scoped lang="stylus">

</style>